import { createRouter, createWebHistory } from "vue-router";
import Home from "@/views/Home/Home.vue";
import Login from "@/views/Auth/Login.vue";
import Register from "@/views/Auth/Register.vue";
import Carts from "@/views/Carts/Carts.vue";

import PersonalCenter from "@/views/meall/me.vue";
import OrderList from "@/views/meall/me_comment.vue";
import OrderList1 from "@/views/meall/me_like.vue";
import OrderList2 from "@/views/meall/me_coupon.vue";
import Logistics from "@/views/meall/Logistics.vue";
import change from "@/views/meall/change.vue";
import evaluation from "@/views/meall/me_evaluation.vue";

import type from "@/views/Type/type.vue";
import Service from "@/views/Service/Service.vue";

import userInfor from "@/views/AccountManagement/userInfor.vue";
import shippingAddress from "@/views/AccountManagement/shippingAddress.vue";
import Account_Management from "@/views/AccountManagement/Account_Management.vue";
import ProductDetail from "@/components/ProductDetail.vue";

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
  },
  {
    path: "/login",
    name: "Login",
    component: Login,
  },
  {
    path: "/register",
    name: "Register",
    component: Register,
  },
  {
    path: "/carts",
    name: "Carts",
    component: Carts,
  },
  {
    path: "/personal-center",
    name: "PersonalCenter",
    component: PersonalCenter,
  },
  { path: "/order-list", name: "order-list", component: OrderList },
  { path: "/order-list1", name: "order-list1", component: OrderList1 },
  { path: "/order-list2", name: "order-list2", component: OrderList2 },
  {
    path: "/type",
    name: "type",
    component: type,
  },
  {
    path: "/service",
    name: "service",
    component: Service,
  },
  {
    path: "/userInfor",
    name: "userInfor",
    component: userInfor,
  },
  {
    path: "/shippingAddress",
    name: "shippingAddress",
    component: shippingAddress,
  },
  {
    path: "/Account_Management",
    name: "Account_Management",
    component: Account_Management,
  },
  {
    path: "/logistics",
    name: "Logistics",
    component: Logistics,
  },
  {
    path: "/change",
    name: "change",
    component: change,
  },
  {
    path: "/evaluation",
    name: "evaluation",
    component: evaluation,
  },
  {
    path: "/product/:id",
    name: "ProductDetail",
    component: ProductDetail,
    props: true,
  },
];

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes,
});

export default router;
